import cvmfs_plugin
import time

class Audience(cvmfs_plugin.Plugin):

    def handle_msg(self, src, subject, body):
        print "=== incoming message ==="
        print "sender: %s" % src
        print "subject: %s" % subject
        print "body: %s" % body

if __name__ == '__main__':
    import sys, os
    if len(sys.argv) != 2:
        print "Usage: %s <target_pid>" % sys.argv[0]
        sys.exit(0)

    audience = Audience(int(sys.argv[1]))
    audience.subscribe('Pop')

    while True:
        time.sleep(1)

